﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using Jobs.Inf.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace Jobs.Inf.DataContext
{
    public class Context : DbContext
    {
        public static string CONNECTION_STRING = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectStr"].ToString();

        #region DbContext
        /// <summary>
        /// 商家
        /// </summary>
        public DbSet<Advertiser> Advertiser { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        public DbSet<Member> Member { get; set; }

        /// <summary>
        /// 职位信息
        /// </summary>
        public DbSet<Position> Position { get; set; }

        /// <summary>
        /// 简历
        /// </summary>
        public DbSet<ResumeSheet> ResumeSheet { get; set; }

        /// <summary>
        /// 招募单
        /// </summary>
        public DbSet<RecruitSheet> RecruitSheet { get; set; }

        /// <summary>
        /// 职位申请单
        /// </summary>
        public DbSet<RequestSheet> RequestSheet { get; set; }
        #endregion

        public Context()
            : base(CONNECTION_STRING)
        { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
